package top.whysu.edevice.constant;

/**
 * 萤石（Ezviz Easy View/Vision）相关常量
 */
public class EzvizConstant {
    /**
     * API
     */
    public static final class Api {
        /**
         * 获取Access Token
         */
        public static final String GET_ACCESS_TOKEN = "https://open.ys7.com/api/lapp/token/get";
        /**
         * 播放地址接口(新接口)
         */
        public static final String GET_LIVE_ADDRESS = "https://open.ys7.com/api/lapp/v2/live/address/get";
        /**
         * 添加设备
         */
        public static final String DEVICE_ADD = "https://open.ys7.com/api/lapp/device/add";
        /**
         * 删除设备
         */
        public static final String DEVICE_DELETE = "https://open.ys7.com/api/lapp/device/delete";
        /**
         * 修改设备名称
         */
        public static final String DEVICE_RENAME = "https://open.ys7.com/api/lapp/device/name/update";
        /**
         * 查询用户下设备基本信息列表
         */
        public static final String LAPP_DEVICE_LIST = "https://open.ys7.com/api/lapp/device/list";
        /**
         * 获取单个设备信息
         */
        public static final String LAPP_DEVICE_INFO = "https://open.ys7.com/api/lapp/device/info";
        /**
         * 获取摄像头列表
         */
        public static final String LAPP_CAMERA_LIST = "https://open.ys7.com/api/lapp/camera/list";
        /**
         * 创建子账号
         */
        public static final String LAPP_ACCOUNT_CREATE = "https://open.ys7.com/api/lapp/ram/account/create";
        /**
         * 删除子账户
         */
        public static final String LAPP_ACCOUNT_DELETE = "https://open.ys7.com/api/lapp/ram/account/delete";
        /**
         * 获取单个子账户信息
         */
        public static final String LAPP_ACCOUNT_INFO = "https://open.ys7.com/api/lapp/ram/account/get";
        /**
         * 获取子账户信息列表
         */
        public static final String LAPP_ACCOUNT_LIST = "https://open.ys7.com/api/lapp/ram/account/list";
        /**
         * 修改当前子账户密码
         */
        public static final String LAPP_ACCOUNT_UPDATE_PASSWORD = "https://open.ys7.com/api/lapp/ram/account/updatePassword";
        /**
         * 设置子账号的授权策略
         */
        public static final String LAPP_ACCOUNT_SET_POLICY = "https://open.ys7.com/api/lapp/ram/policy/set";
        /**
         * 获取B模式子账户accessToken
         */
        public static final String LAPP_ACCOUNT_ACCESS_TOKEN = "https://open.ys7.com/api/lapp/ram/token/get";
        /**
         * 增加子账户权限
         */
        public static final String DEVICE_ADD_TO_CHILE_ACCOUNT = "https://open.ys7.com/api/lapp/ram/statement/add";
        /**
         * 删除子账号权限
         */
        public static final String ACCOUNT_DELETE_FROM_CHILE_ACCOUNT = "https://open.ys7.com/api/lapp/ram/statement/delete";
    }

    /**
     * 公共返回码
     */
    public static final class Code {
        /**
         * 操作成功
         */
        public static final Integer SUCCESS = 200;
        /**
         * 参数错误
         */
        public static final Integer PARAM_ERROR = 10001;
        /**
         * accessToken过期或异常
         */
        public static final Integer ACCESS_TOKEN_EXPIRE = 10002;
        /**
         * appKey异常或被冻结
         */
        public static final Integer APPKEY_ERROR = 10005;
        /**
         * 无权限调用
         */
        public static final Integer REFUSE_ACCESS = 10013;
        /**
         * 子账户或萤石用户没有权限
         */
        public static final Integer ACCOUNT_REFUSE_ACCESS = 10031;
        /**
         * 子账户名不存在
         */
        public static final Integer ACCOUNT_DID_NOT_EXIST = 10032;
        /**
         * 子账号未设置授权策略
         */
        public static final Integer ACCOUNT_DID_NOT_AUTH = 10033;
        /**
         * 子账号已存在
         */
        public static final Integer ACCOUNT_ALREADY_EXIST = 10034;
        /**
         * 获取子账户AccessToken异常,子账户不存在或子账户不属于该开发者
         */
        public static final Integer ACCESS_TOKEN_ERROR = 10035;
        /**
         * 子账号被禁用
         */
        public static final Integer ACCOUNT_FORBIDDEN = 10036;
        /**
         * 设备不存在
         */
        public static final Integer DEVICE_NOT_EXIST = 20002;
        /**
         * 设备不在线
         */
        public static final Integer DEVICE_OFFLINE = 20007;
        /**
         * 设备验证码错误
         */
        public static final Integer DEVICE_CODE_ERROR = 20010;
        /**
         * 设备添加失败
         */
        public static final Integer DEVICE_ADD_FAIL = 20011;
        /**
         * 设备已被别人添加
         */
        public static final Integer DEVICE_ALREADY_ADD_BY_OTHER = 20013;
        /**
         * deviceSerial不合法
         */
        public static final Integer DEVICE_SERIAL_ILLEGAL = 20014;
        /**
         * 设备已被自己添加
         */
        public static final Integer DEVICE_ALREADY_ADD_BY_MYSELF = 20017;
        /**
         * 该用户不拥有该设备
         */
        public static final Integer DEVICE_NOT_BELONG_TO_YOU = 20018;
        /**
         * 数据异常，接口调用异常
         */
        public static final Integer DATA_ERROR = 49999;
        /**
         * 服务器异常
         */
        public static final Integer SERVER_ERROR = 50000;
        /**
         * 海康设备不能使用出场时的默认验证码
         */
        public static final Integer DEVICE_CAN_NOT_USE_DEFAULT_CODE = 60066;
    }

    /**
     * 权限
     */
    public static final class Permission {
        /**
         * 修改资源，例如修改设备名称、通道名称
         */
        public static final String UPDATE = "Update";
        /**
         * 查询资源信息，包括配置信息等
         */
        public static final String GET = "Get";
        /**
         * 设备完全控制，包括Real、Replay、Capture、Video、Ptz、Upgrade、Format、Pipe、Config等现已定义的设备操作权限和以后定义的设备操作权限
         */
        public static final String DEV_CTRL = "DevCtrl";
        /**
         * 视频预览
         */
        public static final String REAL = "Real";
        /**
         * 视频回放（包括本地录像回放和云存储回放）
         */
        public static final String REPLAY = "Replay";
        /**
         * 设备抓图
         */
        public static final String CAPTURE = "Capture";
        /**
         * 设备录像
         */
        public static final String VIDEO = "Video";
        /**
         * 设备云台控制
         */
        public static final String PTZ = "Ptz";
        /**
         * 设备升级
         */
        public static final String UPGRADE = "Upgrade";
        /**
         * 格式化设备磁盘
         */
        public static final String FORMAT = "Format";
        /**
         * 使用开放平台透明通道功能
         */
        public static final String PIPE = "Pipe";
        /**
         * 配置设备，例如视频加密，布撤防，关联NVR和IPC等
         */
        public static final String CONFIG = "Config";
    }
}
